import {createRouter, createWebHashHistory} from 'vue-router';

//系统路由
const routes = [
	{
		name: "layout",
		path: "/",
		component: () => import(/* webpackChunkName: "layout" */ '@/layout'),
		redirect: '/home',
		children: [
			{
				name: "home",
				path: "/home",
				meta: {
					title: "首页"
				},
				component: () => import(/* webpackChunkName: "home" */ '@/views/home'),
			},
			{
				name: "template",
				path: "/template",
				meta: {
					title: "模板"
				},
				component: () => import(/* webpackChunkName: "layout" */ '@/layout/empty'),
				children: [
					{
						name: "list",
						path: "/template/list",
						meta: {
							title: "普通列表"
						},
						component: () => import(/* webpackChunkName: "list" */ '@/views/template/list'),
					},
					{
						name: "data",
						path: "/template/data",
						meta: {
							title: "数据统计"
						},
						component: () => import(/* webpackChunkName: "data" */ '@/views/template/data'),
					}
				]
			},
			{
				name: "setting",
				path: "/setting",
				meta: {
					title: "设置"
				},
				component: () => import(/* webpackChunkName: "layout" */ '@/layout/empty'),
				children: [
					{
						name: "system",
						path: "/setting/system",
						meta: {
							title: "产品设置"
						},
						component: () => import(/* webpackChunkName: "system" */ '@/views/setting/system'),
					},
				]
			}
		]
	}
]

const router = createRouter({
	history: createWebHashHistory(),
	routes: routes
})

export default router
